//
//  PicCollectionViewCell.m
//  01 微博
//
//  Created by zhoup on 16/5/27.
//  Copyright © 2016年 zhoup. All rights reserved.
//

#import "PicCollectionViewCell.h"

@interface PicCollectionViewCell()

@property(nonatomic,strong)IBOutlet UIButton *addBtn;

@property(nonatomic,strong)IBOutlet UIButton *delBtn;

@end

@implementation PicCollectionViewCell
- (IBAction)addPic:(id)sender {
    NSLog(@"%s",__func__);
    
    [[NSNotificationCenter defaultCenter] postNotificationName:KAddPicFormPhoto object:nil userInfo:nil];
}

- (IBAction)delPic:(id)sender {
    NSLog(@"%s",__func__);
    
    // 发送删除的通知
    [[NSNotificationCenter defaultCenter] postNotificationName:KDeletePicFormPhoto object:self];
}

-(void)setIconImage:(UIImage *)iconImage
{
    _iconImage = iconImage;
    
    if (iconImage == nil) {
        [self.addBtn setBackgroundImage:[UIImage imageNamed:@"compose_pic_add"] forState:UIControlStateNormal];
    }
    else
    {
        [self.addBtn setBackgroundImage:iconImage forState:UIControlStateNormal];
    }
}

@end
